<?php
/**
 * ============================================================================
 * @copyright China International Consulting. 中国国际咨询
 * @version:  v1.0
 * @website   http://www.chinacons.com
 * ---------------------------------------------
 * $Date: 2007.12.17
*/
  if ( $_POST["btn_sub"])
  {
    $zh_cate_title = work_str($_POST["zh_cate_title"], 1);				//中文分类名称
    $en_cate_title = work_str($_POST["en_cate_title"], 1);				//英文分类名称
	$other_cate_title = work_str($_POST['other_cate_title'],1);			//其他语言分类名称
	$cate_order = intval($_POST["cate_order"]);							//排列顺序
    $zh_cate_desc = work_str($_POST["zh_cate_desc"]);					//中文分类说明
	$en_cate_desc = work_str($_POST["en_cate_desc"]);					//英文分类说明
	$other_cate_desc = work_str($_POST['other_cate_desc']);				//其他语言分类说明
	$parent = (int)$cPath;
	$query = "SELECT * FROM $TBL_NEWS WHERE cate_id=$parent LIMIT 1";
	if( do_query( $query,1) > 0)
	{
		MyNotice("上一级分类下已经有文章,请先移除文章后再添加此级分类!");
		exit;
	}
	$query = "INSERT INTO $TBL_CATE SET zh_cate_title='$zh_cate_title',en_cate_title='$en_cate_title',other_cate_title='$other_cate_title',cate_order='$cate_order',zh_cate_desc='$zh_cate_desc',en_cate_desc='$en_cate_desc',other_cate_desc='$other_cate_desc',parent_id='$parent',type='1',cate_date_added='".get_Now()."'";
	$res = mysql_query($query, $con) or die(mysql_error());
	MyNotice("添加成功",2,"news_cate.php.$param");
	exit(0);
  }
  $tpl->set_file(array("right" => "add_cate.htm"));
  $tpl->parse("Output", "right");
  $right_page = $tpl->get("Output");
?>